package com.tensquare.base;

import entity.Result;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import util.IdWorker;

@SpringBootApplication
@EnableDiscoveryClient   
//@EnableEurekaClient   (这种也可以，上面那种通用性高)
public class BaseApplication {

    public static void main(String[] args) {
        SpringApplication.run(BaseApplication.class);
    }

    //将idworker生成器放进springIOC容器中
    @Bean
    public IdWorker getIdWorker(){
        return new IdWorker(0,1);
    }
}
